﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfBCliente.aspx.cs" Inherits="NovaSystem.InterfazUsuarioWeb.Ventas.wfBCliente" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Register assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <base target=_self>
    <link rel="Stylesheet" type="text/css" href="../styles/system.css" />
    <title>Proveedores</title>
    <script type="text/javascript" src="../javascript/jsFunciones.js"></script>
    <script language="javascript" type="text/javascript">
        var EmptyDataText = "No Records Found"
        function ShowEmptyDataHeader() {
            var Grid = document.getElementById("<%=gvDetalle.UniqueID%>");
            if (Grid != null) {
                //var cell = Grid.getElementsByTagName("TD")[0];
                //if (cell != null && cell.innerHTML == EmptyDataText) {
                //if (cell.innerHTML != '') {
                    document.getElementById("divEncabezado").style.display = "none";
            }
        }
        
        window.onload = ShowEmptyDataHeader;
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table cellpadding="0" cellspacing="0" border="0" width="760px" class="tabla">
    <tr>
    <td colspan="10" background="<%= Page.ResolveUrl("~")%>img/separadormenu.png">
        <asp:TextBox ID="txtSeparadorEnc" style="visibility:hidden" runat="server"></asp:TextBox>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        </td>
    </tr>
    <tr>
    <td><br /></td>
    </tr>
    <tr>
    <td>Rut</td>
    <td><asp:TextBox runat="server" ID="txtRut" Width="91px"></asp:TextBox></td>
    <td>Nombre</td>
    <td><asp:TextBox runat="server" ID="txtNombre" Width="189px"></asp:TextBox></td>
    <td>País</td>
    <td><asp:DropDownList runat="server" ID="ddlPais" DataTextField="descripcion" 
            DataValueField="codigo"></asp:DropDownList></td>
    </tr>
    <tr>
    <td>Contacto</td>
    <td><asp:TextBox runat="server" ID="txtContacto"></asp:TextBox></td>
    <td>Correo Contacto</td>
    <td><asp:TextBox runat="server" ID="txtCorreoContacto" Width="191px"></asp:TextBox></td>
    <td><asp:Button runat="server" ID="btnBuscar" Text="Buscar" 
            onclick="btnBuscar_Click" /></td>
    </tr>
    <tr>
    <td><br /></td>
    </tr>
    <tr>
    <td colspan="10" background="<%= Page.ResolveUrl("~")%>img/separador.png">
    
        <asp:TextBox ID="txtSeparadorPie" style="visibility:hidden" runat="server" 
            Height="17px"></asp:TextBox>
    
    </td>
    </tr>
    </table>
    
     <table cellpadding="0" cellspacing="0" border="0" width="760px" class="tabla">
    <tr>
    <td colspan="10" background="<%= Page.ResolveUrl("~")%>img/separadormenu.png">
        <asp:TextBox ID="txtSeparadorEncDet" style="visibility:hidden" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
    <td colspan="10">
            <div id="divEncabezado">
            <table class="mGrid">
            <tr>
            <th>Rut</th>
            <th>Nombre</th>
            <th>Contacto</th>
            <th>Correo Contacto</th>
            <th>País</th>
            <th></th>
            </tr>
            <tr>
            <td colspan="10" align="center">Sin registros</td>
            </tr>
            </table>
            </div>
    </td>
    </tr>
    <tr>
    <td colspan="10">
    <div>
    <asp:GridView runat="server" ID="gvDetalle" CssClass="mGrid" 
            EmptyDataText="No existen registros" AutoGenerateColumns="False" 
            onrowdatabound="gvDetalle_RowDataBound" 
            onrowcreated="gvDetalle_RowCreated"><EmptyDataRowStyle Width="450px" HorizontalAlign="Center" /> 
        <Columns>
            <asp:BoundField DataField="idCliente" HeaderText="idCliente" />
            <asp:BoundField DataField="rutCliente" HeaderText="Rut" />
            <asp:BoundField DataField="NombreCliente" HeaderText="Nombre" />
            <asp:BoundField DataField="Contacto" HeaderText="Contacto" />
            <asp:BoundField DataField="telefono" HeaderText="Fono" />
            <asp:BoundField DataField="email" HeaderText="email" />
            <asp:BoundField DataField="codigoPais" HeaderText="Pais" />
        </Columns>
        </asp:GridView>
    </div>
    </td>
    </tr>
    <tr>
    <td colspan="10" align="center">
        <asp:HiddenField ID="hfRut" runat="server" />
        <asp:HiddenField ID="hfNombre" runat="server" />
        <asp:Button runat="server" ID="btnNuevo" Text="Nuevo" /> &nbsp;&nbsp;&nbsp; <asp:Button runat="server" ID="btnCancelar" Text="Cancelar" />
        </td>
    
    </tr>
    <tr>
    <td colspan="10" background="<%= Page.ResolveUrl("~")%>img/separador.png">
    
        <asp:TextBox ID="txtSeparadorPieDet" style="visibility:hidden" runat="server" 
            Height="17px"></asp:TextBox>
    
    </td>
    </tr>
    </table>
    </div>
    <cc1:ModalPopupExtender ID="mpeNuevo"
         TargetControlID="btnNuevo" 
    PopupControlID="pnlNuevoProveedor"
    CancelControlID="btnCancelarNew"
    DropShadow="true"
    BackgroundCssClass="fondoDisabled"
      runat="server">
    </cc1:ModalPopupExtender>
    <div>
    <asp:Panel runat="server" ID="pnlNuevoProveedor">
    <table cellpadding="0" cellspacing="0" border="0" width="700px" class="tabla">
    <tr>
    <td align="center" colspan="4" 
            background="<%= Page.ResolveUrl("~")%>img/separadormenu.png">
    
        <asp:Label ID="lblTituloSeparadorNew" runat="server" 
            Height="17px"></asp:Label>
    
        &nbsp;</td>
    </tr>
    <tr>
    <td><br /></td>
    </tr>
    <tr>
    <td>Rut</td>
    <td><asp:TextBox runat="server" id="txtRutNew"></asp:TextBox> 
        <asp:RequiredFieldValidator ID="rfvRutNew" runat="server" 
            ControlToValidate="txtRutNew" ErrorMessage="Rut Cliente" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        <asp:CustomValidator ID="cvRut" runat="server" 
            ClientValidationFunction="checkRutField" ControlToValidate="txtRutNew" 
            ErrorMessage="Rut no válido" ValidationGroup="Grabar"></asp:CustomValidator>
        </td>
    <td>Nombre</td>
    <td><asp:TextBox runat="server" id="txtNombreNew" Width="294px"></asp:TextBox> 
        <asp:RequiredFieldValidator ID="rfvNombreNew" runat="server" 
            ControlToValidate="txtNombreNew" ErrorMessage="Nombre Cliente" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
    <td>País</td>
    <td><asp:DropDownList runat="server" ID="ddlPaisNew" DataTextField="descripcion" 
            DataValueField="codigo"></asp:DropDownList></td>
    <td>Dirección</td>
    <td><asp:TextBox runat="server" ID="txtDireccionNew" Width="292px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvDireccionNew" runat="server" 
            ControlToValidate="txtDireccionNew" ErrorMessage="Direccion Cliente" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
    <td>Ciudad</td>
    <td><asp:TextBox runat="server" ID="txtCiudadNew"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvCiudadNew" runat="server" 
            ControlToValidate="txtCiudadNew" ErrorMessage="Ciudad Cliente" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    <td>Provincia</td>    
    <td><asp:TextBox runat="server" ID="txtProvinciaNew"></asp:TextBox></td>
    </tr>
    <tr>
    <td>Contacto</td>
    <td><asp:TextBox runat="server" ID="txtContactoNew"></asp:TextBox></td>
    <td>Telefono</td>
    <td><asp:TextBox runat="server" ID="txtFonoNew"></asp:TextBox></td>
    </tr>
    <tr>
    <td>Email</td>
    <td><asp:TextBox runat="server" ID="txtEmailNew"></asp:TextBox></td>
    <td>Tel.Movil</td>
    <td><asp:TextBox runat="server" ID="txtMovilNew" Width="128px"></asp:TextBox></td>
    </tr>
    <tr>
    <td><br /></td>
    </tr>
    <tr>
    <td colspan="4" align="center">
        <asp:Button runat="server" Text="Grabar" 
            ID="btnGrabarNew" onclick="btnGrabarNew_Click" ValidationGroup="Grabar" />
        &nbsp;&nbsp;
        <asp:Button ID="btnCancelarNew" runat="server" Text="Cancelar" 
             />
        </td>
    </tr>
    <tr>
    <td align="center" colspan="10">
        <asp:Label ID="lblMsgGrabar" runat="server" CssClass="errorResaltado"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <br />
        </td>
        </tr>
    <tr>
    <td colspan="4" background="<%= Page.ResolveUrl("~")%>img/separador.png">
    
        <asp:TextBox ID="txtSeparadorPieNew" style="visibility:hidden" runat="server" 
            Height="17px"></asp:TextBox>
    
    </td>
    </tr>
    </table>
    
    </asp:Panel>
    </div>
    
    
    </form>
</body>
</html>
